import logging
import traceback

from pony.orm import db_session

from task import celery

logger = logging.getLogger(__name__)


@celery.task(ignore_result=True)
@db_session(immediate=True)
def test_task(id):
    try:
        logger.info('test_task')
        print(id)
        print('test good')
    except Exception:
        logger.error('error: {}'.format(str(traceback.format_exc())))
